Skip to content

gh-130474: Create and implement flaky resource#130489

Closed
floor-licker wants to merge 17 commits intopython:mainfrom
floor-licker:flaky-resource
Closed

gh-130474: Create and implement flaky resource#130489
floor-licker wants to merge 17 commits intopython:mainfrom
floor-licker:flaky-resource

Conversation

@floor-licker
Copy link

@floor-licker floor-licker commented Feb 23, 2025

I've created the resource and implemented it in some obvious places where comments pointed to flaky tests. There were certain tests I left alone as although they were marked flaky by inline comments, there were other decorators addressing this, for example certain tests that were marked as being flaky without the GIL are already marked with the @support.requires_gil_enabled decorator which I think makes more sense.

As with other resources, the use-case for decorating tests is just:

from test.support import requires_resource

@requires_resource('flaky')
def test_flaky_test():
...

With this set-up, in CI environments we can configure the CI to run flaky tests separately and to automatically retry failed flaky tests::

python -m test --use=flaky --rerun

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants